Skip to main content

All Questions

Tagged with
16votes
1answer
29kviews

Is Collection.stream().filter().forEach() inefficient compared to a standard for each loop?

IntelliJ IDEA recommended to me just now to replace the following for-each loop with a Java 8 "forEach" call: for (Object o : objects) { if (o instanceof SomeObject) { ...
Mirrana's user avatar
  • 1,077
71votes
3answers
34kviews

Is there a performance benefit to using the method reference syntax instead of lambda syntax in Java 8?

Do method references skip the overhead of the lambda wrapper? Might they in the future? According to the Java Tutorial on Method References: Sometimes... a lambda expression does nothing but call an ...
GlenPeterson's user avatar

close